﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ToolUltity;

namespace Medicare
{
    public partial class FrmLogin : Form
    {
        private LoginUser user;
        public FrmLogin()
        {
            InitializeComponent();
            user = new LoginUser();
        }

        private void btnLogin_Click(object sender, EventArgs e)
        {

            int i = user.checkLogin(textBox1.Text,textBox2.Text);
            if (i == -1)
            {
                MessageBox.Show("非法的用户名！");
                return;
            }
            if (i == 0)
            {
                this.Close();
            }
            if (i == 1)
            {
                MessageBox.Show("密码不正确!");
                return;
            }


        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
